From 8e00f6e5e504c8076d4e2d1fdf011772bfc3b6b1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 16 Apr 2023 04:36:12 +0200 Subject: [PATCH] wayland: Don't insta-crash when a surface gets disposed We want to remove the event queue from the list of event queues, not the surface. Otherwise the freed queue stays in the list and the next time an event comes in, we access invalid memory. Fixes thinko introduced in commit 7fafa5133b5. Luckily, we leak all surfaces, so this problem never occured. --- gdk/wayland/gdksurface-wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 36aac757b0..0389822f80 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -556,7 +556,7 @@ gdk_wayland_surface_dispose (GObject *object) GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)); display_wayland->event_queues = - g_list_remove (display_wayland->event_queues, surface); + g_list_remove (display_wayland->event_queues, impl->event_queue); g_clear_pointer (&impl->event_queue, wl_event_queue_destroy); } -- 2.30.2